public class demo21 {
    public static void main(String[] args) {

        int[] a = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        int sum = a[0];
        double ave = 0;
        for (int i = 1; i < a.length; i++) {
            sum = sum + a[i];
            int max = a[0];
            if (a[i] > max) {
                max = a[i];
            }
            int min = a[0];
            if (a[i] < min) {
                min = a[i];
            }
            ave = (double) (sum - min - max) / a.length;

        }

        System.out.println("最终得分为" + ave);

    }
}
